package gspringboot

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type GinWebTempConfig interface {
	LoadHTMLGlob(loadHTMLGlob func(pattern string))
	LoadHTMLFiles(loadHTMLFiles func(files ...string))
	Static(static func(relativePath, root string))
	StaticFS(staticFS func(relativePath string, fs http.FileSystem))
	StaticFile(staticFile func(relativePath, filepath string))
}

func NewDefaultGinWebTempConfig() GinWebTempConfig {
	return &defaultGinWebTempConfig{}
}

var _ GinWebTempConfig = (*defaultGinWebTempConfig)(nil)

type defaultGinWebTempConfig struct{}

func (my defaultGinWebTempConfig) LoadHTMLGlob(loadHTMLGlob func(pattern string)) {
	loadHTMLGlob("templates/*")
}

func (my defaultGinWebTempConfig) LoadHTMLFiles(loadHTMLFiles func(files ...string)) {

}

func (my defaultGinWebTempConfig) Static(static func(relativePath string, root string)) {
	static("/static", "./static")
}

func (my defaultGinWebTempConfig) StaticFS(staticFS func(relativePath string, fs http.FileSystem)) {

}

func (my defaultGinWebTempConfig) StaticFile(staticFile func(relativePath string, filepath string)) {

}

// GinEngineConfig gin服务配置
type GinEngineConfig interface {
	Set(engine *gin.Engine)
}
